luci-base: uci.js: prevent sending empty uci set operations
authorJo-Philipp Wich <[email protected]>
Fri, 22 Jul 2022 22:10:17 +0000 (00:10 +0200)
committerJo-Philipp Wich <[email protected]>
Fri, 22 Jul 2022 22:14:38 +0000 (00:14 +0200)
commitdf15ea39ff869dda75c692f86a2391241062d163
treef2c4529d61fb7ff5eeb0b588b0141b499eb24e12
parentcd970917154ccc21e82d8c41c90326d4727b8ac0
luci-base: uci.js: prevent sending empty uci set operations

Under certain circumstances, a staged uci option value might get unset
again before saving the config, leaving an empty section change set
behind, causing the save call to send an empty uci set request via rpc,
triggering an ubus code 4 (Resource not found) error.

In particular this prevented bridge VLANs from getting saved properly.

Fixes: #5876
Signed-off-by: Jo-Philipp Wich <[email protected]>
(cherry picked from commit 25dcd0b77c4450b83cd8b8307397e58c34ebfcd1)
modules/luci-base/htdocs/luci-static/resources/uci.js